<?php
declare (strict_types = 1);

namespace app\model;

use think\Model;
use think\model\concern\SoftDelete;

/**
 * @property bool $bot 类型:0=用户,1=机器人
 * @property bool $online 状态:0=下线,1=在线
 * @property bool $sex 性别:0=先生,1=女士
 * @property bool $sign_notice 签到提醒:0=关,1=开
 * @property int $code
 * @property int $credit 信用分
 * @property int $deletetime 删除时间
 * @property int $gpt_num
 * @property int $help 帮助数量
 * @property int $id
 * @property int $invite_code 邀请码
 * @property int $reght 被采纳次数
 * @property int $score 积分
 * @property int $vip_expire 会员过期时间
 * @property string $createtime 注册时间
 * @property string $head_image 头像
 * @property string $logintime 登陆时间
 * @property string $mobile 手机号
 * @property string $nickname 昵称
 * @property string $qq_openid
 * @property string $signature 个性签名
 * @property string $updatetime
 * @property string $wechat_openid
 * @property-read \app\model\UsersFollow[] $fans
 * @property-read \app\model\UsersFollow[] $follow
 * @method static \think\db\Query onlyTrashed()
 * @method static \think\db\Query withTrashed()
 * @mixin \think\Model
 */
class Users extends Model
{
	
	use SoftDelete;
	protected $deleteTime = 'deletetime';
    protected $createTime = 'createtime';
    protected $updateTime = 'updatetime';

    protected $type = [
        'logintime'=>'timestamp'
    ];
    

    function follow()
    {
        return $this->hasMany(UsersFollow::class,'to_users_id','id');
    }

    function fans()
    {
        return $this->hasMany(UsersFollow::class,'users_id','id');
    }




}
